package com.example.chatroom.dao.mapper;

import com.example.chatroom.dao.dataobject.ApplyFriendDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ApplyFriendMapper {

    public Long insert(ApplyFriendDO applyFriendDO);

    /**
     * 通过toId获取好友申请列表
     * @param userId
     * @return
     */
    List<ApplyFriendDO> selectInfoBytoId(@Param("userId") Long userId);

    /**
     * 根据Id返回state的值
     * @param id
     * @return
     */
    ApplyFriendDO selectById(@Param("id") Long id);

    /**
     * 更新state
     * @param id
     */
    void updateState(Long id,Integer state);
}
